package com.aotain.oframework.util.mail;

import java.util.List;
import java.util.Map;

public class EmailParam implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	/** Receiver Email Address **/
	private String toEmail;
	/** Receiver Name **/
	private String toName;

	/** 如果toEmail 为空 那么就发送邮件给toContacts和ccContacts **/
	private List<EmailContact> toContacts;
	private List<EmailContact> ccContacts;

	/** Velocity Template to be used **/
	private String vmLocation;

	/** Email Subject **/
	private String subject;

	/** Sender Email Address **/
	private String fromMail;

	/** Sender Name **/
	private String formName;

	/** The data to be used in rendering Velocity Template **/
	private Map<String, Object> vmMap;

	/** 如果vmLocation 为空那么邮件的内容就会是这个属性 **/
	private String emailContent;

	public EmailParam() {
		super();
	}

	/**
	 * 发送邮件给多个联系人,邮件内容为模板路径定义的内容
	 * 
	 * @param toContacts
	 *            发送人
	 * @param ccContacts
	 *            抄送人
	 * @param vmLocation
	 *            模板路径
	 * @param subject
	 *            主题
	 * @param vmMap
	 *            模板参数
	 */
	public EmailParam(List<EmailContact> toContacts, List<EmailContact> ccContacts, String vmLocation, String subject, Map<String, Object> vmMap) {
		super();
		this.toContacts = toContacts;
		this.ccContacts = ccContacts;
		this.vmLocation = vmLocation;
		this.subject = subject;
		this.vmMap = vmMap;
	}

	/**
	 * 发送给单个联系人,邮件内容为模板路径定义的内容
	 * 
	 * @param toEmail
	 *            邮件接受人
	 * @param vmLocation
	 *            模板路径
	 * @param toName
	 *            邮件接受人名字
	 * @param subject
	 *            主题
	 * @param vmMap
	 *            模板参数
	 */
	public EmailParam(String toEmail, String vmLocation, String toName, String subject, Map<String, Object> vmMap) {
		super();
		this.toEmail = toEmail;
		this.vmLocation = vmLocation;
		this.toName = toName;
		this.subject = subject;
		this.vmMap = vmMap;
	}

	/**
	 * 
	 * 发送给单个联系人,邮件内容为模板路径定义的内容
	 * 
	 * @param toEmail
	 *            邮件接受人
	 * @param vmLocation
	 *            模板路径
	 * @param toName
	 *            邮件接受人名字
	 * @param subject
	 *            主题
	 * @param fromMail
	 * @param formName
	 * @param vmMap
	 *            模板参数
	 */
	public EmailParam(String toEmail, String vmLocation, String toName, String subject, String fromMail, String formName, Map<String, Object> vmMap) {
		super();
		this.toEmail = toEmail;
		this.vmLocation = vmLocation;
		this.toName = toName;
		this.subject = subject;
		this.fromMail = fromMail;
		this.formName = formName;
		this.vmMap = vmMap;
	}

	/**
	 * 发送给单个联系人,邮件内容为emailContent
	 * 
	 * @param toEmail
	 *            邮件接受人
	 * @param emailContent
	 *            邮件内容
	 * @param toName
	 *            邮件接受人名字
	 * @param subject
	 *            主题
	 * @param fromMail
	 * @param formName
	 */
	public EmailParam(String toEmail, String emailContent, String toName, String subject, String fromMail, String formName) {
		super();
		this.toEmail = toEmail;
		this.emailContent = emailContent;
		this.toName = toName;
		this.subject = subject;
		this.fromMail = fromMail;
		this.formName = formName;
	}

	/**
	 * 发送邮件给多个联系人,邮件内容为emailContent
	 * 
	 * @param toContacts
	 *            发送人
	 * @param ccContacts
	 *            抄送人
	 * @param vmLocation
	 *            模板路径
	 * @param subject
	 *            主题
	 * @param vmMap
	 *            模板参数
	 */
	public EmailParam(List<EmailContact> toContacts, List<EmailContact> ccContacts, String emailContent, String subject) {
		super();
		this.toContacts = toContacts;
		this.ccContacts = ccContacts;
		this.subject = subject;
		this.emailContent = emailContent;
	}

	public String getFromMail() {
		return fromMail;
	}

	public void setFromMail(String fromMail) {
		this.fromMail = fromMail;
	}

	public String getFormName() {
		return formName;
	}

	public void setFormName(String formName) {
		this.formName = formName;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public String getToEmail() {
		return toEmail;
	}

	public void setToEmail(String toEmail) {
		this.toEmail = toEmail;
	}

	public String getVmLocation() {
		return vmLocation;
	}

	public void setVmLocation(String vmLocation) {
		this.vmLocation = vmLocation;
	}

	public String getToName() {
		return toName;
	}

	public void setToName(String toName) {
		this.toName = toName;
	}

	public Map<String, Object> getVmMap() {
		return vmMap;
	}

	public void setVmMap(Map<String, Object> vmMap) {
		this.vmMap = vmMap;
	}

	public List<EmailContact> getToContacts() {
		return toContacts;
	}

	public void setToContacts(List<EmailContact> toContacts) {
		this.toContacts = toContacts;
	}

	public List<EmailContact> getCcContacts() {
		return ccContacts;
	}

	public void setCcContacts(List<EmailContact> ccContacts) {
		this.ccContacts = ccContacts;
	}

	public String getEmailContent() {
		return emailContent;
	}

	public void setEmailContent(String emailContent) {
		this.emailContent = emailContent;
	}

}
